package com.wr.dao;

import com.wr.model.Article;
import com.wr.model.RestResponse;
import com.wr.utils.PageData;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author weirong
 * @Title:
 * @Description:
 * @date 2018/6/1118:12
 */
@FeignClient(value = "blog-server")
public interface ArticleDao {

    @RequestMapping(value = "blog/detail")
     RestResponse<Article> detail(@RequestParam(value = "id") Integer id);

    @RequestMapping(value = "blog/add")
     RestResponse<Article> add(@RequestBody Article article);

    @RequestMapping(value = "blog/mainList")
     RestResponse<List<Article>> mainList(@RequestParam(value = "pageNo") Integer pageNo,@RequestParam(value = "pageSize") Integer pageSize);

    @RequestMapping(value = "blog/listPd")
     RestResponse<List<Article>> listPd(@RequestBody PageData pd);
}
